<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="table-box tablenes">
            <div class="title">持证人</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">人员姓名</td><td id="person_name" class="tv colorlan" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">证书信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">证书分类</td><td id="type" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">证书名称</td><td id="name" class="tv"></td><td class="tt">证书编号</td><td id="number" class="tv"></td></tr>
                <tr><td class="tt">发证单位</td><td id="issue_unit" class="tv"></td><td class="tt">注册/发证日期</td><td id="issue_dt" class="tv"></td></tr>
                <tr><td class="tt">专业</td><td id="major" class="tv"></td><td class="tt">有效期止</td><td id="expiry_dt" class="tv"></td></tr>
                <tr><td class="tt">证书形式</td><td id="form" class="tv"></td><td class="tt">证书状态</td><td id="state" class="tv"></td></tr>
                <tr id="outDiv" class="layui-hide"><td class="tt">注销/转出时间</td><td class="tv" id="out_dt" colspan="3"></td></tr>
                <tr><td class="tt">电子件有效期</td><td id="electron_dt" class="tv"></td><td class="tt">下次年检时间</td><td id="inspect_dt" class="tv"></td></tr>
                <tr><td class="tt">保管人</td><td id="custodian_name" class="tv"></td><td class="tt">存放地</td><td id="store_addr" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                <tr><td class="tt">证书使用情况</td><td class="tv" id="statueuse" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>



        <div><?php include "../public/upinfo_show.php";?></div>
        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">证书使用记录</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_cert_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;

                $("#person_name").text(data.person_name).click(function () {
                    openPage('../person/show.php?id='+data.personid);
                });
                $("#type").text(data.type);
                $("#name").text(data.name);
                $("#number").text(data.number);
                $("#issue_unit").text(data.issue_unit);
                $("#issue_dt").text(data.issue_dt);
                $("#major").text(data.major);
                $("#expiry_dt").text(data.expiry_dt);
                $("#form").text(data.form);
                $("#state").text(data.state);
                $("#electron_dt").text(data.electron_dt);
                $("#inspect_dt").text(data.inspect_dt);
                $("#custodian_name").text(data.custodian_name);
                $("#store_addr").text(data.store_addr);

                if(data.status == 2 || data.status == 3){
                    $("#out_dt").text(data.out_dt);
                    $("#outDiv").removeClass('layui-hide');
                }

                $("#explain").text(data.explain);
                $("#statueuse").text(data.statueuse);




                var mytableList = table.render({
                    elem: "#datalist",data:res.data.use_list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field:'enginid_name',title:'项目名称',templet: function(d){
                                return '<span class="colorlan" onclick="openPage(\'../engin/show.php?id='+d.enginid+'\')">'+d.enginid_name+'</span>';
                            }}
                        ,{field: 'engin_state', title: '项目状态'}
                        ,{field: 'place', title: '岗位'}
                        ,{field: 'statueuse', title: '使用情况'}
                        ,{field: 'issuo', title: '是否锁证'}
                        ,{field: 'startdt', title: '使用开始时间'}
                        ,{field: 'yudt', title: '预计结束时间'}
                        ,{field: 'enddt', title: '使用结束时间'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('cert', param_id);
        showpage_dropopt();
    });



</script>
</body>
</html>




